FEAT(geometry): Add Haversine formula and fix build issues #6650
+112
−7
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello! This PR adds the Haversine formula algorithm and also includes two small fixes for issues I found while setting up the development environment.
This implementation is of the
Haversine
formula to calculate the distance between two points on a sphereNew Feature: Haversine Formula
Haversine.java
) to thegeometry
package. This algorithm calculates the great-circle distance between two points on a sphere using their latitude and longitude.HaversineTest.java
) with multiple test cases to ensure correctness.Build and Bug Fixes
To get the project to build and run tests successfully, I also made the following corrections:
pom.xml
: Updated the Maven compiler plugin configuration from<source>
/<target>
to the modern<release>
tag. This resolves a build warning that was treated as an error when using newer JDKs.PartitionProblem.java
: Corrected a Javadoc formatting error where the comment was placed before thepackage
declaration, which caused a build failure due to the-Werror
flag.All tests pass successfully with these changes. Let me know if any further modifications are needed!